home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Medabots Cardz
/
Medabots CD Cardz Metabee.bin
/
mac
/
assets
/
metabee.dxr
/
00006_Script_6
< prev
next >
Wrap
Text File
|
2001-12-07
|
3KB
|
118 lines
property pSpeed, dx, dy, mysprite, counter, buttonover
global showarea, discx, discy, area, smallmedal, portdy, portdx, goback, portnum, medaldown, transitionz, playonce, onedown, amiwideopen
on beginsprite me
set mysprite to the spritenum of me
set the blend of sprite mysprite = 100
set dx to the loch of sprite(mysprite)
set dy to the locv of sprite(mysprite)
counter = 1
end
on mouseEnter me
if smallmedal = 0 then
showarea = 1
buttonover = 1
puppetsound ("hum2"),2
end if
end
on mouseLeave me
if smallmedal = 0 then
showarea = 0
buttonover = 0
set the member of sprite mysprite = ("medal")
puppetsound 1,0
end if
end
on mouseDown me
medaldown = 1
end
on mouseUp me
medaldown = 0
if smallmedal = 0 then
if sprite mysprite intersects sprite(portnum) then
onedown = 1
set the blend of sprite mysprite = 0
set the loch of sprite mysprite to dx
set the locv of sprite mysprite to dy
smallmedal = 1
area = 1
transitionz = "close"
else
set the loch of sprite mysprite to dx
set the locv of sprite mysprite to dy
end if
end if
end
on exitframe
if medaldown = 1 then
buttonover = 0
end if
if area = 0 then
if amiwideopen = "yes" then
sprite(mysprite).moveablesprite = TRUE
end if
else
sprite(mysprite).moveablesprite = FALSE
end if
if goback = 1 then
set the blend of sprite mysprite = 100
goback = 0
end if
if buttonover = 1 then
if counter < 6 then
counter = counter + 1
end if
if counter = 2 then
set the member of sprite mysprite = ("roll1")
else if counter = 3 then
set the member of sprite mysprite = ("roll2")
else if counter = 4 then
set the member of sprite mysprite = ("roll3")
else if counter = 5 then
set the member of sprite mysprite = ("roll4")
else if counter = 6 then
set the member of sprite mysprite = ("roll5")
counter = 1
end if
end if
if sprite mysprite intersects sprite(portnum) then
-- set the width of sprite(mysprite) to 38
-- set the height of sprite(mysprite) to 40
else
-- set the width of sprite(mysprite) to 66
-- set the height of sprite(mysprite) to 77
end if
end
-- move character
on move me, dx, dy
-- get current loc
loc = sprite(me.spriteNum).loc
-- move loc and rect
global pSpeed
loc = loc + point(dx,dy)*pSpeed
rect = rect + rect(dx*pSpeed,dy*pSpeed,dx*pSpeed,dy*pSpeed)
-- safety check to make sure character stays on screen
if rect.left < 0 then exit
if rect.top < 0 then exit
if rect.right > (the stage).rect.width then exit
if rect.bottom > (the stage).rect.height then exit
-- set new character location
sprite(me.spriteNum).loc = loc
end